package com.zcy.util;

import java.io.Serializable;
import java.util.Properties;

import org.hibernate.HibernateException;
import org.hibernate.MappingException;
import org.hibernate.engine.spi.SessionImplementor;
import org.hibernate.id.Configurable;
import org.hibernate.service.ServiceRegistry;
import org.hibernate.type.Type;


public class IdentifierGenerator implements org.hibernate.id.IdentifierGenerator, Configurable {

	protected IdGenerate idWorker = new IdGenerate(31, 512);


	public Serializable generate(SessionImplementor paramSessionImplementor, Object paramObject)
			throws HibernateException {
		
		return idWorker.nextId();
	}

	@Override
	public void configure(Type type, Properties properties, ServiceRegistry serviceRegistry) throws MappingException {

	}
}
